Direct-Mapped Cache

  • The most obvious way to map main memory blocks to cache blocks (lines)

Contention between cache lines increases as the main memory increases respective to the cache. If cache is 4 blocks and main memory is 8 blocks, if the main memory is increased by 8 blocks, then cache will receive a 100% increase in contention for space.

Disadvantages of Direct-mapped cache

Direct-mapped caches have a higher chance for thrashing. This happens when two memory blocks who map to the same location on the cache are accessed repeatedly, leading to constant memory access, slowing down the system.